Dynomotion

Group: DynoMotion Message: 12495 From: cnc_machines Date: 11/6/2015
Subject: Cycle Time Delays
Greetings,

We are using the Kflop to run parts with a very short cycle time, roughly 2-10 seconds. Every second of cycle time is very important as we make thousands of parts per day.

The feature to "Execute PC" is VERY helpful, we have it running a custom M-Code at the beginning and end of the program to update cycle time to the network. My problem is, each time this M-Code runs the CNC program stalls for roughly 0.5 seconds, for a total loss of 1 second for each part. Is there anything that we can do to reduce this time? Is KMotionCNC waiting for the program to finish, or is this just the time that it takes to launch the application?

I have also seen a stall in coordinated motion when the spindle changes speeds. It was much more pronounced on version 433K, now that we are on 433Q motion only freezes for roughly 0.2 seconds. Was this an intentional upgrade? Any idea if we could reduce this time as well?

Thanks,

Scott


Group: DynoMotion Message: 12496 From: Hardy Family Date: 11/6/2015
Subject: Re: Cycle Time Delays

Re improving the spindle speed update:  depends how you are doing it.  If you are running a c program on the kflop then you can try flashing that program into a dedicated thread so that it does not have to be loaded each time.  Set the cnc options to just execute that thread for the S word instead of compile/load.  If you do that, then it only takes 10ms or so to update.

For the network update, if it is not an option to run it every (say) 10 parts, then you might need to change the program so it finishes immediately, but leaves a task running in the background to actually complete the network stuff.

Regards,
Sjh

On Nov 6, 2015 2:58 PM, "cnc_machines@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:
 

Greetings,

We are using the Kflop to run parts with a very short cycle time, roughly 2-10 seconds. Every second of cycle time is very important as we make thousands of parts per day.

The feature to "Execute PC" is VERY helpful, we have it running a custom M-Code at the beginning and end of the program to update cycle time to the network. My problem is, each time this M-Code runs the CNC program stalls for roughly 0.5 seconds, for a total loss of 1 second for each part. Is there anything that we can do to reduce this time? Is KMotionCNC waiting for the program to finish, or is this just the time that it takes to launch the application?

I have also seen a stall in coordinated motion when the spindle changes speeds. It was much more pronounced on version 433K, now that we are on 433Q motion only freezes for roughly 0.2 seconds. Was this an intentional upgrade? Any idea if we could reduce this time as well?

Thanks,

Scott


Group: DynoMotion Message: 12499 From: TK Date: 11/7/2015
Subject: Re: Cycle Time Delays
Hi Scott,

The GCode Interpreter does wait for the "Execute PC" program to complete and exit before proceeding.   Maybe your PC Program takes 0.5 sec to load/execute/exit?   If you don't want it to wait then you might Execute a Batch file instead that will Launch your PC Program as a background Process using a Start Command.  I tested a Batch file of: Bat0.bat:
start c:\temp\bat1.bat

Where bat1.bat just executed a CMD to print the Path
path
exit

Calling the M100 in a loop to Execute the Bat0.bat file 1000 times took 27 seconds (27ms each).

M98 P1 L1000  (example using L to specify the loop count)
M30
O1
M100
M99

I Also tested an S1000 command to "Execute Prog" of Spindle_S_Kstep.c.  It took 55ms per spindle command to Set the Speed, Compile, Download, Execute.  There is a patch available for 4.33q to skip the compilation step by specifying a .out file of (ie.  Spindle_S_Kstep(3).out).  This reduced the time to 26milliseconds.  Specifying no filename at all only sets the Speed value and Executes the Thread in KFLOP.  This reduced the time to 1.3ms.

I'm not sure why your S command is taking so long.  Is it configured to wait?  What is your S Program doing?

Regards
TK


On 11/6/2015 2:58 PM, cnc_machines@... [DynoMotion] wrote:
 

Greetings,

We are using the Kflop to run parts with a very short cycle time, roughly 2-10 seconds. Every second of cycle time is very important as we make thousands of parts per day.

The feature to "Execute PC" is VERY helpful, we have it running a custom M-Code at the beginning and end of the program to update cycle time to the network. My problem is, each time this M-Code runs the CNC program stalls for roughly 0.5 seconds, for a total loss of 1 second for each part. Is there anything that we can do to reduce this time? Is KMotionCNC waiting for the program to finish, or is this just the time that it takes to launch the application?

I have also seen a stall in coordinated motion when the spindle changes speeds. It was much more pronounced on version 433K, now that we are on 433Q motion only freezes for roughly 0.2 seconds. Was this an intentional upgrade? Any idea if we could reduce this time as well?

Thanks,

Scott



Group: DynoMotion Message: 12502 From: cnc_machines Date: 11/9/2015
Subject: Re: Cycle Time Delays
Tom,

Thank you for the ideas on the M Code, we will give the bat file a try and see how it works. Regarding the spindle I have a servo motor set up on channel 3 as step and direction. I am passing in the spindle speed through variable "S" to jog the axis at the speed corresponding to the RPM.

In my INIT file Axis 3 is NOT set as one of the coordinated motion axes.

DefineCoordSystem(0,1,-1,2);  //Define XYZ coordinated motion axes

I was assuming this would not affect motion on the other axes when the jog speed was changed.


Here is the program that runs when the "S" is called in the CNC program.

#include "KMotionDef.h"

// desired speed is passed in variable 1


main()
{
    float speed = *(float *)&persist.UserData[0];  // value stored is actually a float
   
    Jog(3,(speed*1000/66.6));
   
}

Thanks,

Scott
Group: DynoMotion Message: 12507 From: cnc_machines Date: 11/10/2015
Subject: Re: Cycle Time Delays
Tom,

I am having trouble with the .bat files you described. How exactly do I get it to launch as a background process? I am currently using the following bat files to launch a python program (.5 seconds each). How do I get it to run in the background so it immediately returns?

Did you have any suggestions from my previous post about the spindle program? I understood pointing to the out file, but wasn't sure how I could get it to execute the thread in the KFLOP for the 1.3ms time.

Thanks,

Scott
Group: DynoMotion Message: 12508 From: cnc_machines Date: 11/10/2015
Subject: Re: Cycle Time Delays
I missed your reply, thanks but I do have a question. How do I set the CNC options to just execute the thread? Do select "Execute Prog", leave the "C File" blank and then specify which thread the spindle program is flashed to?

Thanks,

Scott
Group: DynoMotion Message: 12509 From: cnc_machines Date: 11/10/2015
Subject: Re: Cycle Time Delays
Attachments :
Forgot to attach the image.
  @@attachment@@
Group: DynoMotion Message: 12510 From: TK Date: 11/11/2015
Subject: Re: Cycle Time Delays [1 Attachment]
Hi Sam,

I think you would change the line:

python newstart.py
to
start python newstart.py


Regarding S word:  Yes just leave the name blank and it should just execute the specified Thread.  Of course it is up to you to make sure the S program is compiled and downloaded to that Thread beforehand at least once.

Regards
TK

On 11/10/2015 3:47 PM, cnc_machines@... [DynoMotion] wrote:
 

Forgot to attach the image.